package com.atguigu.chapter05

object practice2 {

  def main(args: Array[String]): Unit = {

    def f(i:Int):String=>(Char=>Boolean) = {
      def f1(s:String):Char=>Boolean={
        def f2(c: Char): Boolean = {
          if (i==0&&s==""&&c=='c')  true else false
        }
        f2
      }
      f1
    }

    println(f(0)("")('c'));
    println(f(1)("")('c'));
    println(f(0)("")('f'));
    println(f(0)(" ")('c'));

    println("========================")
    def func(i:Int):String=>(Char=>Boolean) = {
      s:String=>c: Char => if (i==0&&s==""&&c=='c')  true else false
    }


    println(func(0)("")('c'));
    println(func(1)("")('c'));
    println(func(0)("")('f'));
    println(func(0)(" ")('c'));

    def func1(i:Int)(s:String)(c:Char) ={
      if (i==0&&s==""&&c=='c')  true else false
    }
    println(func1(0)("")('c'));
    println(func1(1)("")('c'));
    println(func1(0)("")('f'));
    println(func1(0)(" ")('c'));

  }
}

